<template>
  <!-- 已放款 -->
  <div class="box clearfix">
    <section class="section_wrap">
      <FunctionalAreas :orderNumber="orderNumber"></FunctionalAreas>
      <div class="title_sub prduct_bod_r">产品说明：</div>
      <ProductDescriptionToo></ProductDescriptionToo>
    </section>

    <section class="section_wrap">
      <div style="width:100%;">
        <div class="title_sub infro_bod_l">信息查看：</div>
        <div class="state" v-if="this.orderStatus == 6">状态：已中止</div>
        <div class="state" v-if="this.orderStatus == 5">状态：已归档</div>
        <TerInfor></TerInfor>
      </div>
    </section>
    <section class="section_wrap">
      <div class="title_sub upload_bod_l" id="testjq">附件管理：</div>
      <!-- 上传组件 -->
      <Upload class="uploadStyle" :isNew="isNew"></Upload>
    </section>

    <section class="section_wrap">
      <div class="title_sub infro_bod_l">审批流：</div>
      <ApprovalText :orderNumber="orderNumber"></ApprovalText>
      <div class="title_sub infro_bod_l">操作记录：</div>
      <OperationRecords :orderNumber="orderNumber"></OperationRecords>
    </section>
  </div>
</template>

<script>
import FunctionalAreas from "../../components/mortgage/FunctionalAreas";
import ProductDescriptionToo from "../../components/business/ProductDescriptionToo";
import ApprovalText from "../../components/mortgage/ApprovalText";
import TerInfor from "../../components/mortgage/TerInfor";
import Upload from "../../components/mortgage/Upload";
import OperationRecords from "../../components/business/OperationRecords";

import { getProductUrl } from "../../../src/assets/js/api";

export default {
  name: "ToBeLent",
  components: {
    FunctionalAreas,
    ProductDescriptionToo,
    TerInfor,
    ApprovalText,
    Upload,
    OperationRecords
  },
  data() {
    return {
      pending: true,
      orderNumber: "",
      orderStatus: "",
      isNew: false,
      status: null,
      golbalPermissions: [],
      ProductUrl: ""
    };
  },
  created() {
    this.golbalPermissions = localStorage.getItem("permissions").split(",");
    this.orderNumber = sessionStorage.getItem("orderNumber");
    this.findProductUrl(this.orderNumber);
  },
  methods: {
    //根据订单查询路由path路径
    findProductUrl(orderNumber) {
      getProductUrl({
        orderNumber: orderNumber
      }).then(res => {
        this.ProductUrl = res.data.productUrl;
        this.orderStatus = res.data.orderStatus;
      });
    }
  }
};
</script>

<style scoped type="less">
.text {
  font-size: 20px;
  font-weight: bold;
  text-align: left;
  margin-top: 20px;
  text-indent: 2em;
}
.state {
  font-size: 22px;
  font-weight: bold;
  float: right;
  margin-top: -34px;
  margin-right: 3%;
}
</style>
